3.544 \(\int \frac {(c+d \sin (e+f x))^2}{\sqrt {a+a \sin (e+f x)}} \, dx\)

Optimal. Leaf size=123 \[ -\frac {4 d (3 c-d) \cos (e+f x)}{3 f \sqrt {a \sin (e+f x)+a}}-\frac {\sqrt {2} (c-d)^2 \tanh ^{-1}\left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {2} \sqrt {a \sin (e+f x)+a}}\right )}{\sqrt {a} f}-\frac {2 d^2 \cos (e+f x) \sqrt {a \sin (e+f x)+a}}{3 a f} \]

[Out]

-(c-d)^2*arctanh(1/2*cos(f*x+e)*a^(1/2)*2^(1/2)/(a+a*sin(f*x+e))^(1/2))*2^(1/2)/f/a^(1/2)-4/3*(3*c-d)*d*cos(f*
x+e)/f/(a+a*sin(f*x+e))^(1/2)-2/3*d^2*cos(f*x+e)*(a+a*sin(f*x+e))^(1/2)/a/f

________________________________________________________________________________________

Rubi [A]  time = 0.20, antiderivative size = 123, normalized size of antiderivative = 1.00, number of steps used = 4, number of rules used = 4, integrand size = 27, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.148, Rules used = {2761, 2751, 2649, 206} \[ -\frac {4 d (3 c-d) \cos (e+f x)}{3 f \sqrt {a \sin (e+f x)+a}}-\frac {\sqrt {2} (c-d)^2 \tanh ^{-1}\left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {2} \sqrt {a \sin (e+f x)+a}}\right )}{\sqrt {a} f}-\frac {2 d^2 \cos (e+f x) \sqrt {a \sin (e+f x)+a}}{3 a f} \]

Antiderivative was successfully verified.

[In]

Int[(c + d*Sin[e + f*x])^2/Sqrt[a + a*Sin[e + f*x]],x]

[Out]

-((Sqrt[2]*(c - d)^2*ArcTanh[(Sqrt[a]*Cos[e + f*x])/(Sqrt[2]*Sqrt[a + a*Sin[e + f*x]])])/(Sqrt[a]*f)) - (4*(3*
c - d)*d*Cos[e + f*x])/(3*f*Sqrt[a + a*Sin[e + f*x]]) - (2*d^2*Cos[e + f*x]*Sqrt[a + a*Sin[e + f*x]])/(3*a*f)

Rule 206

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1*ArcTanh[(Rt[-b, 2]*x)/Rt[a, 2]])/(Rt[a, 2]*Rt[-b, 2]), x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 2649

Int[1/Sqrt[(a_) + (b_.)*sin[(c_.) + (d_.)*(x_)]], x_Symbol] :> Dist[-2/d, Subst[Int[1/(2*a - x^2), x], x, (b*C
os[c + d*x])/Sqrt[a + b*Sin[c + d*x]]], x] /; FreeQ[{a, b, c, d}, x] && EqQ[a^2 - b^2, 0]

Rule 2751

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*sin[(e_.) + (f_.)*(x_)]), x_Symbol] :> -Simp[(d
*Cos[e + f*x]*(a + b*Sin[e + f*x])^m)/(f*(m + 1)), x] + Dist[(a*d*m + b*c*(m + 1))/(b*(m + 1)), Int[(a + b*Sin
[e + f*x])^m, x], x] /; FreeQ[{a, b, c, d, e, f, m}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] &&  !LtQ[m,
-2^(-1)]

Rule 2761

Int[((a_) + (b_.)*sin[(e_.) + (f_.)*(x_)])^(m_)*((c_) + (d_.)*sin[(e_.) + (f_.)*(x_)])^2, x_Symbol] :> -Simp[(
d^2*Cos[e + f*x]*(a + b*Sin[e + f*x])^(m + 1))/(b*f*(m + 2)), x] + Dist[1/(b*(m + 2)), Int[(a + b*Sin[e + f*x]
)^m*Simp[b*(d^2*(m + 1) + c^2*(m + 2)) - d*(a*d - 2*b*c*(m + 2))*Sin[e + f*x], x], x], x] /; FreeQ[{a, b, c, d
, e, f, m}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 - b^2, 0] &&  !LtQ[m, -1]

Rubi steps

\begin {align*} \int \frac {(c+d \sin (e+f x))^2}{\sqrt {a+a \sin (e+f x)}} \, dx &=-\frac {2 d^2 \cos (e+f x) \sqrt {a+a \sin (e+f x)}}{3 a f}+\frac {2 \int \frac {\frac {1}{2} a \left (3 c^2+d^2\right )+a (3 c-d) d \sin (e+f x)}{\sqrt {a+a \sin (e+f x)}} \, dx}{3 a}\\ &=-\frac {4 (3 c-d) d \cos (e+f x)}{3 f \sqrt {a+a \sin (e+f x)}}-\frac {2 d^2 \cos (e+f x) \sqrt {a+a \sin (e+f x)}}{3 a f}+(c-d)^2 \int \frac {1}{\sqrt {a+a \sin (e+f x)}} \, dx\\ &=-\frac {4 (3 c-d) d \cos (e+f x)}{3 f \sqrt {a+a \sin (e+f x)}}-\frac {2 d^2 \cos (e+f x) \sqrt {a+a \sin (e+f x)}}{3 a f}-\frac {\left (2 (c-d)^2\right ) \operatorname {Subst}\left (\int \frac {1}{2 a-x^2} \, dx,x,\frac {a \cos (e+f x)}{\sqrt {a+a \sin (e+f x)}}\right )}{f}\\ &=-\frac {\sqrt {2} (c-d)^2 \tanh ^{-1}\left (\frac {\sqrt {a} \cos (e+f x)}{\sqrt {2} \sqrt {a+a \sin (e+f x)}}\right )}{\sqrt {a} f}-\frac {4 (3 c-d) d \cos (e+f x)}{3 f \sqrt {a+a \sin (e+f x)}}-\frac {2 d^2 \cos (e+f x) \sqrt {a+a \sin (e+f x)}}{3 a f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [C]  time = 0.39, size = 125, normalized size = 1.02 \[ -\frac {2 \left (\sin \left (\frac {1}{2} (e+f x)\right )+\cos \left (\frac {1}{2} (e+f x)\right )\right ) \left (d \left (\cos \left (\frac {1}{2} (e+f x)\right )-\sin \left (\frac {1}{2} (e+f x)\right )\right ) (6 c+d \sin (e+f x)-d)-(3+3 i) (-1)^{3/4} (c-d)^2 \tanh ^{-1}\left (\left (\frac {1}{2}+\frac {i}{2}\right ) (-1)^{3/4} \left (\tan \left (\frac {1}{4} (e+f x)\right )-1\right )\right )\right )}{3 f \sqrt {a (\sin (e+f x)+1)}} \]

Antiderivative was successfully verified.

[In]

Integrate[(c + d*Sin[e + f*x])^2/Sqrt[a + a*Sin[e + f*x]],x]

[Out]

(-2*(Cos[(e + f*x)/2] + Sin[(e + f*x)/2])*((-3 - 3*I)*(-1)^(3/4)*(c - d)^2*ArcTanh[(1/2 + I/2)*(-1)^(3/4)*(-1
+ Tan[(e + f*x)/4])] + d*(Cos[(e + f*x)/2] - Sin[(e + f*x)/2])*(6*c - d + d*Sin[e + f*x])))/(3*f*Sqrt[a*(1 + S
in[e + f*x])])

________________________________________________________________________________________

fricas [B]  time = 0.46, size = 286, normalized size = 2.33 \[ \frac {\frac {3 \, \sqrt {2} {\left (a c^{2} - 2 \, a c d + a d^{2} + {\left (a c^{2} - 2 \, a c d + a d^{2}\right )} \cos \left (f x + e\right ) + {\left (a c^{2} - 2 \, a c d + a d^{2}\right )} \sin \left (f x + e\right )\right )} \log \left (-\frac {\cos \left (f x + e\right )^{2} - {\left (\cos \left (f x + e\right ) - 2\right )} \sin \left (f x + e\right ) - \frac {2 \, \sqrt {2} \sqrt {a \sin \left (f x + e\right ) + a} {\left (\cos \left (f x + e\right ) - \sin \left (f x + e\right ) + 1\right )}}{\sqrt {a}} + 3 \, \cos \left (f x + e\right ) + 2}{\cos \left (f x + e\right )^{2} - {\left (\cos \left (f x + e\right ) + 2\right )} \sin \left (f x + e\right ) - \cos \left (f x + e\right ) - 2}\right )}{\sqrt {a}} - 4 \, {\left (d^{2} \cos \left (f x + e\right )^{2} + 6 \, c d - 2 \, d^{2} + {\left (6 \, c d - d^{2}\right )} \cos \left (f x + e\right ) + {\left (d^{2} \cos \left (f x + e\right ) - 6 \, c d + 2 \, d^{2}\right )} \sin \left (f x + e\right )\right )} \sqrt {a \sin \left (f x + e\right ) + a}}{6 \, {\left (a f \cos \left (f x + e\right ) + a f \sin \left (f x + e\right ) + a f\right )}} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*sin(f*x+e))^2/(a+a*sin(f*x+e))^(1/2),x, algorithm="fricas")

[Out]

1/6*(3*sqrt(2)*(a*c^2 - 2*a*c*d + a*d^2 + (a*c^2 - 2*a*c*d + a*d^2)*cos(f*x + e) + (a*c^2 - 2*a*c*d + a*d^2)*s
in(f*x + e))*log(-(cos(f*x + e)^2 - (cos(f*x + e) - 2)*sin(f*x + e) - 2*sqrt(2)*sqrt(a*sin(f*x + e) + a)*(cos(
f*x + e) - sin(f*x + e) + 1)/sqrt(a) + 3*cos(f*x + e) + 2)/(cos(f*x + e)^2 - (cos(f*x + e) + 2)*sin(f*x + e) -
 cos(f*x + e) - 2))/sqrt(a) - 4*(d^2*cos(f*x + e)^2 + 6*c*d - 2*d^2 + (6*c*d - d^2)*cos(f*x + e) + (d^2*cos(f*
x + e) - 6*c*d + 2*d^2)*sin(f*x + e))*sqrt(a*sin(f*x + e) + a))/(a*f*cos(f*x + e) + a*f*sin(f*x + e) + a*f)

________________________________________________________________________________________

giac [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: NotImplementedError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*sin(f*x+e))^2/(a+a*sin(f*x+e))^(1/2),x, algorithm="giac")

[Out]

Exception raised: NotImplementedError >> Unable to parse Giac output: Unable to check sign: (4*pi/x/2)>(-4*pi/
x/2)Unable to check sign: (4*pi/x/2)>(-4*pi/x/2)Unable to check sign: (4*pi/x/2)>(-4*pi/x/2)Unable to check si
gn: (4*pi/x/2)>(-4*pi/x/2)Unable to check sign: (4*pi/x/2)>(-4*pi/x/2)Unable to check sign: (4*pi/x/2)>(-4*pi/
x/2)Unable to check sign: (4*pi/x/2)>(-4*pi/x/2)Unable to check sign: (4*pi/x/2)>(-4*pi/x/2)Unable to check si
gn: (4*pi/x/2)>(-4*pi/x/2)Unable to check sign: (4*pi/x/2)>(-4*pi/x/2)2/f*(2/sqrt(a*tan((f*x+exp(1))/2)^2+a)/(
a*tan((f*x+exp(1))/2)^2+a)*(tan((f*x+exp(1))/2)*(tan((f*x+exp(1))/2)*(-1/144*tan((f*x+exp(1))/2)*(24*a*d^2*sig
n(tan((f*x+exp(1))/2)+1)-144*a*c*d*sign(tan((f*x+exp(1))/2)+1))-1/144*(-72*a*d^2*sign(tan((f*x+exp(1))/2)+1)+1
44*a*c*d*sign(tan((f*x+exp(1))/2)+1)))-1/144*(72*a*d^2*sign(tan((f*x+exp(1))/2)+1)-144*a*c*d*sign(tan((f*x+exp
(1))/2)+1)))-1/144*(-24*a*d^2*sign(tan((f*x+exp(1))/2)+1)+144*a*c*d*sign(tan((f*x+exp(1))/2)+1)))+sqrt(2)*(c^2
+d^2-2*c*d)*atan((-sqrt(a)*tan((f*x+exp(1))/2)-sqrt(a)+sqrt(a*tan((f*x+exp(1))/2)^2+a))/sqrt(2)/sqrt(-a))/sqrt
(-a)/sign(tan((f*x+exp(1))/2)+1)+(-3*a*c^2*sqrt(2)*atan(sqrt(a)/sqrt(-a))+6*a*c*d*sqrt(2)*atan(sqrt(a)/sqrt(-a
))-3*a*d^2*sqrt(2)*atan(sqrt(a)/sqrt(-a))+6*c*d*sqrt(-a)*sqrt(2)*sqrt(a)-2*d^2*sqrt(-a)*sqrt(2)*sqrt(a))/3/a/s
qrt(-a)*sign(tan((f*x+exp(1))/2)+1))

________________________________________________________________________________________

maple [A]  time = 1.25, size = 185, normalized size = 1.50 \[ -\frac {\left (1+\sin \left (f x +e \right )\right ) \sqrt {-a \left (\sin \left (f x +e \right )-1\right )}\, \left (3 a^{\frac {3}{2}} \sqrt {2}\, \arctanh \left (\frac {\sqrt {a -a \sin \left (f x +e \right )}\, \sqrt {2}}{2 \sqrt {a}}\right ) c^{2}-6 a^{\frac {3}{2}} \sqrt {2}\, \arctanh \left (\frac {\sqrt {a -a \sin \left (f x +e \right )}\, \sqrt {2}}{2 \sqrt {a}}\right ) c d +3 a^{\frac {3}{2}} \sqrt {2}\, \arctanh \left (\frac {\sqrt {a -a \sin \left (f x +e \right )}\, \sqrt {2}}{2 \sqrt {a}}\right ) d^{2}-2 \left (a -a \sin \left (f x +e \right )\right )^{\frac {3}{2}} d^{2}+12 a c d \sqrt {a -a \sin \left (f x +e \right )}\right )}{3 a^{2} \cos \left (f x +e \right ) \sqrt {a +a \sin \left (f x +e \right )}\, f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c+d*sin(f*x+e))^2/(a+a*sin(f*x+e))^(1/2),x)

[Out]

-1/3*(1+sin(f*x+e))*(-a*(sin(f*x+e)-1))^(1/2)*(3*a^(3/2)*2^(1/2)*arctanh(1/2*(a-a*sin(f*x+e))^(1/2)*2^(1/2)/a^
(1/2))*c^2-6*a^(3/2)*2^(1/2)*arctanh(1/2*(a-a*sin(f*x+e))^(1/2)*2^(1/2)/a^(1/2))*c*d+3*a^(3/2)*2^(1/2)*arctanh
(1/2*(a-a*sin(f*x+e))^(1/2)*2^(1/2)/a^(1/2))*d^2-2*(a-a*sin(f*x+e))^(3/2)*d^2+12*a*c*d*(a-a*sin(f*x+e))^(1/2))
/a^2/cos(f*x+e)/(a+a*sin(f*x+e))^(1/2)/f

________________________________________________________________________________________

maxima [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {{\left (d \sin \left (f x + e\right ) + c\right )}^{2}}{\sqrt {a \sin \left (f x + e\right ) + a}}\,{d x} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*sin(f*x+e))^2/(a+a*sin(f*x+e))^(1/2),x, algorithm="maxima")

[Out]

integrate((d*sin(f*x + e) + c)^2/sqrt(a*sin(f*x + e) + a), x)

________________________________________________________________________________________

mupad [F]  time = 0.00, size = -1, normalized size = -0.01 \[ \int \frac {{\left (c+d\,\sin \left (e+f\,x\right )\right )}^2}{\sqrt {a+a\,\sin \left (e+f\,x\right )}} \,d x \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((c + d*sin(e + f*x))^2/(a + a*sin(e + f*x))^(1/2),x)

[Out]

int((c + d*sin(e + f*x))^2/(a + a*sin(e + f*x))^(1/2), x)

________________________________________________________________________________________

sympy [F]  time = 0.00, size = 0, normalized size = 0.00 \[ \int \frac {\left (c + d \sin {\left (e + f x \right )}\right )^{2}}{\sqrt {a \left (\sin {\left (e + f x \right )} + 1\right )}}\, dx \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate((c+d*sin(f*x+e))**2/(a+a*sin(f*x+e))**(1/2),x)

[Out]

Integral((c + d*sin(e + f*x))**2/sqrt(a*(sin(e + f*x) + 1)), x)

________________________________________________________________________________________